﻿@model WebApp.Models.BillDetail
<div id="billdetaildlg" class="easyui-dialog"
     title="BillDetail" style="width:600px;height:300px; display:none"
     data-options="
                iconCls: 'fal fa-window',
                modal:true,
                closed:true,
                cache: false,
                resizable:true,
                width:620,
                height:300,
                buttons: [{
                    text:'确认',
                    handler:function(){
                        confirm_billdetailform();
                    }
                },{
                    text:'取消',
                    handler:function(){
                        $('#billdetaildlg').dialog('close');
                    }
                }]
            ">
<div class="panel-container show">
      <div class="panel-content p-0">
        <form id="billdetail_form" class="form-horizontal needs-validation" novalidate>
          <fieldset class="form-group">
            <div class="row h-100 align-items-center m-0 pt-1">
    <!--系统主键-->
	@Html.HiddenFor(model => model.Id)		
             
      <!--BillId-->
      <input type="hidden" id="BillHeaderBillNo" name="BillHeaderBillNo" value="">
	  <input id="@Html.IdFor(model => model.BillId)"
			       name="@Html.NameFor(model => model.BillId)"
				   value="@Html.ValueFor(model => model.BillId)"
                   type="hidden" />
             
    <!--表名-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.MeterName)" > @Html.DisplayNameFor(model => model.MeterName) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.MeterName)" 
							name="@Html.NameFor(model => model.MeterName)" 
							value="@Html.ValueFor(model => model.MeterName)"
							tabindex="2" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.MeterName)',
     						 required:false ,validType:'length[0,50]'" />
    </div>
             
    <!--表序号-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.LineNo)" > @Html.DisplayNameFor(model => model.LineNo) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.LineNo)" 
							name="@Html.NameFor(model => model.LineNo)" 
							value="@Html.ValueFor(model => model.LineNo)"
							tabindex="3" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.LineNo)',
     						 required:false ,validType:'length[0,50]'" />
    </div>
             
    <!--表号-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.MeterId)" > @Html.DisplayNameFor(model => model.MeterId) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.MeterId)" 
							name="@Html.NameFor(model => model.MeterId)" 
							value="@Html.ValueFor(model => model.MeterId)"
							tabindex="4" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.MeterId)',
     						 required:false ,validType:'length[0,20]'" />
    </div>
             
    <!--出线名称-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.MeterName1)" > @Html.DisplayNameFor(model => model.MeterName1) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.MeterName1)" 
							name="@Html.NameFor(model => model.MeterName1)" 
							value="@Html.ValueFor(model => model.MeterName1)"
							tabindex="5" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.MeterName1)',
     						 required:false ,validType:'length[0,50]'" />
    </div>
             
    <!--安装位置-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.MeterPoint)" > @Html.DisplayNameFor(model => model.MeterPoint) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.MeterPoint)" 
							name="@Html.NameFor(model => model.MeterPoint)" 
							value="@Html.ValueFor(model => model.MeterPoint)"
							tabindex="6" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.MeterPoint)',
     						 required:false ,validType:'length[0,150]'" />
    </div>
             
    <!--正负项-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Negitive)" > @Html.DisplayNameFor(model => model.Negitive) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.Negitive)" 
							name="@Html.NameFor(model => model.Negitive)" 
							value="@Html.ValueFor(model => model.Negitive)"
							tabindex="7" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Negitive)',
     						 required:false ,validType:'length[0,10]'" />
    </div>
             
    <!--占比-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Ratio)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.Ratio) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.Ratio)"
							name="@Html.NameFor(model => model.Ratio)" 
							value="@Html.ValueFor(model => model.Ratio)"
							tabindex="8" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Ratio)',
                                 precision:2,
								 required:true,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
    <!--用水量(m3)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Water)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.Water) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.Water)"
							name="@Html.NameFor(model => model.Water)" 
							value="@Html.ValueFor(model => model.Water)"
							tabindex="9" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Water)',
                                 precision:2,
								 required:true,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
    <!--上个月用水量(m3)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.LastWater)" > @Html.DisplayNameFor(model => model.LastWater) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.LastWater)"
							name="@Html.NameFor(model => model.LastWater)" 
							value="@Html.ValueFor(model => model.LastWater)"
							tabindex="10" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.LastWater)',
                                 precision:2,
								 required:false,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
    <!--环比(%)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.PerCent)" > @Html.DisplayNameFor(model => model.PerCent) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.PerCent)"
							name="@Html.NameFor(model => model.PerCent)" 
							value="@Html.ValueFor(model => model.PerCent)"
							tabindex="11" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.PerCent)',
                                 precision:2,
								 required:false,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
    <!--实际用水量(m3)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.ActualWater)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.ActualWater) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.ActualWater)"
							name="@Html.NameFor(model => model.ActualWater)" 
							value="@Html.ValueFor(model => model.ActualWater)"
							tabindex="12" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.ActualWater)',
                                 precision:2,
								 required:true,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
     <!--期初日期-->
          <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.WaterDt1)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.WaterDt1) </label>
		  <div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
          <input id="@Html.IdFor(model => model.WaterDt1)" 
							name="@Html.NameFor(model => model.WaterDt1)" 
							tabindex="13" 
							class="easyui-datebox" 
                            type="text"
                            style="width:100%"
							value="@Html.ValueFor(model => model.WaterDt1)"
							data-options="prompt:'@Html.DisplayNameFor(model => model.WaterDt1)',
								 formatter:dateformatter,
                                 required:true " />
     </div>
             
    <!--期初水量(m3)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Water1)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.Water1) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.Water1)"
							name="@Html.NameFor(model => model.Water1)" 
							value="@Html.ValueFor(model => model.Water1)"
							tabindex="14" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Water1)',
                                 precision:2,
								 required:true,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
     <!--期末日期-->
          <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.WaterDt2)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.WaterDt2) </label>
		  <div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
          <input id="@Html.IdFor(model => model.WaterDt2)" 
							name="@Html.NameFor(model => model.WaterDt2)" 
							tabindex="15" 
							class="easyui-datebox" 
                            type="text"
                            style="width:100%"
							value="@Html.ValueFor(model => model.WaterDt2)"
							data-options="prompt:'@Html.DisplayNameFor(model => model.WaterDt2)',
								 formatter:dateformatter,
                                 required:true " />
     </div>
             
    <!--期末水量(m3)-->
         <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Water2)" ><span class="text-danger">*</span> @Html.DisplayNameFor(model => model.Water2) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
         <input id="@Html.IdFor(model => model.Water2)"
							name="@Html.NameFor(model => model.Water2)" 
							value="@Html.ValueFor(model => model.Water2)"
							tabindex="16" 
							class="easyui-numberbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Water2)',
                                 precision:2,
								 required:true,
                                 formatter:intformatter,
                                 parser:parsernumber
                                 " />
    </div>
             
    <!--备注-->
        <label class="col-md-2  col-sm-3 col-xs-3 col-3 form-label text-right p-0" for="@Html.IdFor(model => model.Remark)" > @Html.DisplayNameFor(model => model.Remark) </label>
<div class="col-md-4  col-sm-9 col-xs-9 col-9 mb-1">
		<input id="@Html.IdFor(model => model.Remark)" 
							name="@Html.NameFor(model => model.Remark)" 
							value="@Html.ValueFor(model => model.Remark)"
							tabindex="17" 
			     			class="easyui-textbox" 
							type="text" 
                            style="width:100%"
							data-options="prompt:'@Html.DisplayNameFor(model => model.Remark)',
     						 required:false ,validType:'length[0,250]'" />
    </div>
             
  
           </div>
       </fieldset>
    </form>
  </div>
</div>
</div>
<script type="text/javascript">
     var form_state = 'Added';
     var current_index = -1;
     var billdetail = {};
 
     function open_billdetaildlg(index, row, state) {
         form_state = state;
         current_index = index;
         billdetail = row;
         $('#billdetaildlg').dialog('open');
         if (form_state === 'Added') {
             $('#billdetaildlg').dialog('setTitle', '新增明细');
         } else {
             $('#billdetaildlg').dialog('setTitle', '修改明细');
         }
         $('#billdetail_form').form('reset');
         $('#billdetail_form').form('load', billdetail);
     }
     function confirm_billdetailform() {
         $billdetailform = $('#billdetail_form');
         if ($billdetailform.form('enableValidation').form('validate')) {
             billdetail = $billdetailform.serializeJSON();
             if (form_state === 'Added') {
                 $(document).trigger('billdetail_form.add', [current_index, billdetail])
             } else {
                 $(document).trigger('billdetail_form.edit', [current_index, billdetail])
             }
             $('#billdetaildlg').dialog('close');
         }
     }
 </script>

 